home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991 …esperately Seeking Seven / Desperately Seeking Seven.2mg / Dev.CD.8 / Essentials / Tools / DTS.Samples / SC05Cust.Wind / CWnd.asm < prev    next >
Encoding:
Assembly Source File  |  1990-05-25  |  27.0 KB  |  793 lines  |  [04] ASCII Text (0x0000)

  1. *******************************************************************************
  2. *
  3. * Custom Window Application
  4. *
  5. * (C)  Copyright Apple Computer, Inc. 1988-1990
  6. * All rights reserved.
  7. *
  8. * Developer Technical Support Apple II Sample Code
  9. *
  10. * by Keith Rollin
  11. *
  12. * This program is not much more than the standard shell that brings up three
  13. * windows. Two of these windows are custom RoundRect windows, and the third
  14. * one is normal window presented for comparison. This program also shows the
  15. * use of _AlertWindow, a call new to System Disk 3.2, and the use of NULL
  16. * events to draw the current time in the menubar.
  17. *
  18. *******************************************************************************
  19. **********************************************************************
  20. *                                                                    *
  21. *             Apple IIGS Source Code Sampler, Volume I               *
  22. *                                                                    *
  23. *           Copyright (c) Apple Computer, Inc. 1988-1990             *
  24. *                       All Rights Reserved                          *
  25. *                                                                    *
  26. *            Written by Apple II Developer Tech Support              *
  27. *                                                                    *
  28. *                                                                    *
  29. *                                                                    *
  30. *  ----------------------------------------------------------------  *
  31. *                                                                    *
  32. *     This program and its derivatives are licensed only for         *
  33. *     use on Apple computers.                                        *
  34. *                                                                    *
  35. *     Works based on this program must contain and                   *
  36. *     conspicuously display this notice.                             *
  37. *                                                                    *
  38. *     This software is provided for your evaluation and to           *
  39. *     assist you in developing software for the Apple IIGS           *
  40. *     computer.                                                      *
  41. *                                                                    *
  42. *     DISCLAIMER OF WARRANTY                                         *
  43. *                                                                    *
  44. *     THE SOFTWARE IS PROVIDED "AS IS" WITHOUT                       *
  45. *     WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,               *
  46. *     WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS             *
  47. *     FOR ANY PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO             *
  48. *     THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH            *
  49. *     YOU.  SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND            *
  50. *     NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE)               *
  51. *     ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING,             *
  52. *     REPAIR OR CORRECTION.                                          *
  53. *                                                                    *
  54. *     Apple does not warrant that the functions                      *
  55. *     contained in the Software will meet your requirements          *
  56. *     or that the operation of the Software will be                  *
  57. *     uninterrupted or error free or that defects in the             *
  58. *     Software will be corrected.                                    *
  59. *                                                                    *
  60. *     SOME STATES DO NOT ALLOW THE EXCLUSION                         *
  61. *     OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY              *
  62. *     NOT APPLY TO YOU.  THIS WARRANTY GIVES YOU SPECIFIC            *
  63. *     LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS                *
  64. *     WHICH VARY FROM STATE TO STATE.                                *
  65. *                                                                    *
  66. *                                                                    *
  67. **********************************************************************
  68.                     eject
  69.                     
  70.  
  71.                     case   on
  72.  
  73.                     copy 2/ainclude/E16.Quickdraw
  74.                     copy 2/ainclude/E16.Memory
  75.                     copy 2/ainclude/E16.EVENT
  76.                     copy 2/ainclude/E16.Window
  77.                     copy 2/ainclude/E16.Dialog
  78.                     mcopy macros/cwnd.macros
  79.  
  80. *******************************************************************************
  81. *
  82. *    Equates used in this program.
  83. *
  84. *******************************************************************************
  85. DPHandle            gequ 0              ; Handle to Tool Direct Page area
  86. DPPointer           gequ DPHandle+4     ; Pointer to Tool Direct Page area
  87. deref               gequ DPPointer+4    ; Temporary Handle dereference area
  88. temp1               gequ deref+4        ; used by DrawTime routine
  89.  
  90. ScreenMode          gequ mode640
  91. ScreenWidth         gequ 640
  92.  
  93.                     EJECT
  94. *******************************************************************************
  95. *
  96. Main                start
  97. *
  98. * Description:      This is the main routine. It calls routines to Initialize
  99. *                   the tools, initialize application specific data, run the
  100. *                   main EventLoop, close the application, and close the tools.
  101. *                   Then it calls the ProDOS Quit command.
  102. *
  103. *
  104. * Inputs:           NONE
  105. *
  106. * Outputs:          NONE
  107. *
  108. * External Refs:
  109. *                   Import InitTools
  110. *                   Import InitApp
  111. *                   Import EventLoop
  112. *                   Import CloseApp
  113. *                   Import CloseTools
  114. *                   Import QuitParms
  115. *
  116. * Entry Points:     NONE
  117. *
  118. *******************************************************************************
  119.  
  120.                     jsr InitTools
  121.                     jsr InitApp
  122.  
  123.                     _ShowCursor
  124.  
  125.                     jsr EventLoop
  126.  
  127.                     jsr CloseApp
  128.                     jsr CloseTools
  129.  
  130.                     _Quit QuitParms
  131.  
  132.                     end
  133.  
  134.                     EJECT
  135. *******************************************************************************
  136. *
  137. Globals             data
  138. *
  139. * Description:      Holder of all of our data.
  140. *
  141. *
  142. * Inputs:           N/A
  143. *
  144. * Outputs:          N/A
  145. *
  146. * External Refs:
  147. *
  148. * Entry Points:
  149. *                   Export QuitParms    ; used by Main
  150. *
  151. *******************************************************************************
  152. *
  153. * Standard global data
  154. *
  155. *******************************************************************************
  156.  
  157. TitleString         str 'Custom Window Sample'
  158. AutString           str 'By Keith Rollin, Apple II DTS'
  159. CopyString          str 'Copyright (c) 1988-1990 Apple Computer'
  160. VerString           str 'Version 3.0        June 19, 1990'
  161.  
  162. AboutData           dc c'73/*0',i1'13',c'*1',i1'13',c'*2',i1'13',c'*3/^#0',i1'0'
  163. SubStrings          dc i4'TitleString,AutString,CopyString,VerString'
  164.  
  165. MenuHeight          ds 2                ; Stored height of menu bar
  166. MyID                ds 2                ; Application ID
  167. MyDP                ds 2                ; My direct page storage
  168.  
  169. QuitFlag            ds 2
  170. QuitParms           dc i4'0'            ; Pathname of next app
  171.                     dc i2'$00'          ; flags
  172.  
  173. EventRecord         ANOP
  174. EventWhat           ds 2
  175. EventMessage        ds 4
  176. EventWhen           ds 4
  177. EventWhere          ds 4
  178. EventModifiers      ds 2
  179. TaskData            ds 4
  180. TaskMask            dc i4'$0000FFFF'
  181.  
  182.                     EJECT
  183. *******************************************************************************
  184. *
  185. * Application specific global data
  186. *
  187. *******************************************************************************
  188.  
  189. ; This is a list of pointers to the text that is used to create our menus. It
  190. ; is used by InitApp to find all of the menu templates and use them to create
  191. ; our menubar. This loop loads MenuPtrLen-4 into an index, gets the
  192. ; corresponding menu template pointer in this table, and uses that in a
  193. ; NewMenu call. It then decrements the index by 4, and repeats the procees
  194. ; until the index is negative.
  195.  
  196. MenuPtr             dc i4'AppMenu'
  197.                     dc i4'FileMenu'
  198.                     dc i4'EditMenu'
  199. MenuPtrLen          equ *-MenuPtr
  200.  
  201.  
  202. ; Menu list: menu items should be numbered consecutivly starting from 250.
  203. ; As a convention, use 256 as about and 257 as Quit.
  204.  
  205. AppMenu             dc c'$$@\XN1',h'00'
  206.                     dc c'--About Custom Window...\N256V',h'00'
  207.                     dc c'.'
  208. FileMenu            dc c'$$  File  \N2',h'0D'
  209.                     dc c'--Open Custom Window 1\N258',h'00'
  210.                     dc c'--Open Custom Window 2\N259',h'00'
  211.                     dc c'--Open Normal Window\N260',h'00'
  212.                     dc c'--Close\N255V',h'00'
  213.                     dc c'--Quit\N257*Qq',h'00'
  214.                     dc c'.'
  215. EditMenu            dc c'$$  Edit  \N3',h'00'
  216.                     dc c'--Undo\N250*ZzVD',h'00'
  217.                     dc c'--Cut\N251*XxD',h'00'
  218.                     dc c'--Copy\N252*CcD',h'00'
  219.                     dc c'--Paste\N253*VvD',h'00'
  220.                     dc c'--Clear\N254D',h'00'
  221.                     dc c'.'
  222.  
  223. TestWindow          dc i4'0'
  224. TestWindow2         dc i4'0'
  225. NormalWindow        dc i4'0'
  226.  
  227.                     end
  228.  
  229.                     EJECT
  230. *******************************************************************************
  231. *
  232. InitApp             start
  233. *
  234. * Description:      Perform any application specific initialization.
  235. *
  236. * Inputs:           NONE
  237. *
  238. * Outputs:          NONE
  239. *
  240. * External Refs:
  241. *                   Import RRectDefProc
  242. *                   Import doUpdate
  243. *
  244. * Entry Points:     NONE
  245. *
  246. *******************************************************************************
  247.                     using Globals
  248.  
  249.                     stz QuitFlag
  250.  
  251.                     pha                 ; space for the window pointer
  252.                     pha
  253.                     PushLong #NormWindRec
  254.                     _NewWindow
  255.                     PullLong NormalWindow
  256.  
  257.                     pha                 ; space for the window pointer
  258.                     pha
  259.                     PushLong #custWindRec
  260.                     _NewWindow
  261.                     PullLong TestWindow
  262.  
  263.                     pha                 ; space for the window pointer
  264.                     pha
  265.                     PushLong #custWindRec2
  266.                     _NewWindow
  267.                     PullLong TestWindow2
  268.  
  269.                     rts
  270.  
  271. WindowTitle1        str '  Custom Window #1  '
  272. WindowTitle2        str '  Custom Window #2  '
  273. WindowTitle3        str '  I am a Normal Window  '
  274.  
  275. myColors            dc i2'$0010' ; Frame color (7-4)
  276.                     dc i2'$02F0' ; Inact ttlbar(11-8), inact ttl(7-4), title (3-0)
  277.                     dc i2'$0005' ; Background color (active titlebar) (3-0)
  278.  
  279. custWindRec         dc i2'0'
  280.                     dc i4'RRectDefProc'
  281.                     dc i2'0'            ; FrameBits
  282.                     dc i2'40,100,160,500'                   ; bounding rectangle
  283.                     dc i4'$FFFFFFFF'    ; plane
  284.                     dc i4'0'            ; storage
  285.                     dc i4'0'            ; refCon
  286.                     dc i4'doUpdate'     ; contDraw
  287.                     dc i4'WindowTitle1' ; window's title
  288.                     dc i4'myColors'     ; colorTable
  289.                     dc i2'$10'          ; vertical radius
  290.                     dc i2'$20'          ; horizontal radius
  291.  
  292. custWindRec2        dc i2'0'
  293.                     dc i4'RRectDefProc'
  294.                     dc i2'fClose+fMove'
  295.                     dc i2'60,140,140,440'                   ; bounding rectangle
  296.                     dc i4'$FFFFFFFF'    ; plane
  297.                     dc i4'0'            ; storage
  298.                     dc i4'0'            ; refCon
  299.                     dc i4'doUpdate'     ; contDraw
  300.                     dc i4'WindowTitle2' ; window's title
  301.                     dc i4'0'            ; colorTable
  302.                     dc i2'$10'          ; vertical radius
  303.                     dc i2'$20'          ; horizontal radius
  304.  
  305. NormWindRec         dc i2'WindEnd-NormWindRec'
  306.                     dc i2'fTitle+fClose+fMove'
  307.                     dc i4'WindowTitle3' ; Ptr to title
  308.                     dc i4'$0'           ; RefCon
  309.                     dc i2'0,0,0,0'      ; Full Size (0= default)
  310.                     dc i4'0'            ; Color Table Pointer
  311.                     dc i2'0,0'          ; Vertical/Horizontal origin
  312.                     dc i2'0,0'          ; Data area height, width
  313.                     dc i2'0,0'          ; Max Cont height, width
  314.                     dc i2'0,0'          ; Pixels to scroll vert'ly, horiz'ly
  315.                     dc i2'0,0'          ; Pixels to page vert'ly, horiz'ly
  316.                     dc i4'0'            ; Information bar refcon.
  317.                     dc i2'0'            ; Info bar height
  318.                     dc i4'0'            ; DefProc.
  319.                     dc i4'0'            ; Routine to draw info. bar.
  320.                     dc i4'doUpdate'     ; Routine to draw content.
  321.                     dc i2'40,40,120,590'                    ; Size and position
  322.                     dc i4'$FFFFFFFF'    ; Plane to put window up in (bottommost).
  323.                     dc i4'0'            ; Address for window record (0 to alloc)
  324. WindEnd             equ *
  325.  
  326.                     end
  327.  
  328.                     EJECT
  329. *******************************************************************************
  330. *
  331. CloseApp            start
  332. *
  333. * Description:      Close down things. This disposes of all items and memory
  334. *                   that we allocated.
  335. *
  336. *
  337. * Inputs:           NONE
  338. *
  339. * Outputs:          NONE
  340. *
  341. * External Refs:    NONE
  342. *
  343. * Entry Points:     NONE
  344. *
  345. *******************************************************************************
  346.                     using Globals
  347.  
  348.                     PushLong TestWindow
  349.                     _CloseWindow
  350.  
  351.                     PushLong TestWindow2
  352.                     _CloseWindow
  353.  
  354.                     PushLong NormalWindow
  355.                     _CloseWindow
  356.  
  357.                     rts
  358.                     end
  359.  
  360.                     EJECT
  361. *******************************************************************************
  362. *
  363. EventLoop           start
  364. *
  365. * Description:      Main Event Loop. Handle things until user selects Quit.
  366. *
  367. *
  368. * Inputs:           NONE
  369. *
  370. * Outputs:          NONE
  371. *
  372. * External Refs:
  373. *                   Import MenuSelect
  374. *                   Import Ignore
  375. *                   Import doUpdate
  376. *                   Import doNullEvent
  377. *                   Import doClose
  378. *
  379. * Entry Points:     NONE
  380. *
  381. *******************************************************************************
  382.                     using Globals
  383.  
  384. maxEvent            equ wInactMenu
  385.  
  386.                     pha                 ; Push on space for TaskMaster result
  387.                     PushWord #everyEvent ; GetNextEvent mask
  388.                     PushLong #EventRecord ; Pointer to Event Record
  389.                     _TaskMaster
  390.  
  391.                     pla                 ; Get TaskMaster result
  392.                     cmp #maxEvent+1     ; do we know this event?
  393.                     blt TaskOK          ; yes - so do it.
  394.                     lda #inNull         ; map unknowns to null events
  395. TaskOK              asl a               ; Turn it into an index
  396.                     tax
  397.                     jsr (TaskTable,x)   ; Call appropriate event handler
  398.  
  399.                     lda QuitFlag        ; Quit selected?
  400.                     beq EventLoop       ; no - keep looping
  401.  
  402.                     rts                 ; yes- leave the program
  403.  
  404. TaskTable           dc i2'doNullEvent'  ; 0 Null
  405.                     dc i2'Ignore'       ; 1 MouseDown
  406.                     dc i2'Ignore'       ; 2 MouseUp
  407.                     dc i2'Ignore'       ; 3 KeyDown
  408.                     dc i2'Ignore'       ; 4 undefined
  409.                     dc i2'Ignore'       ; 5 AutoKey
  410.                     dc i2'Ignore'       ; 6 Update
  411.                     dc i2'Ignore'       ; 7 undefined
  412.                     dc i2'Ignore'       ; 8 Activate
  413.                     dc i2'Ignore'       ; 9 Switch
  414.                     dc i2'Ignore'       ; 10 Desk accessory
  415.                     dc i2'Ignore'       ; 11 Device driver
  416.                     dc i2'Ignore'       ; 12 ap
  417.                     dc i2'Ignore'       ; 13 ap
  418.                     dc i2'Ignore'       ; 14 ap
  419.                     dc i2'Ignore'       ; 15 ap
  420.                     dc i2'Ignore'       ; TASK 0 indesk
  421.                     dc i2'MenuSelect'   ; TASK 1 in menuBar
  422.                     dc i2'Ignore'       ; TASK 2 in system window
  423.                     dc i2'Ignore'       ; TASK 3 in content
  424.                     dc i2'Ignore'       ; TASK 4 in Drag
  425.                     dc i2'Ignore'       ; TASK 5 in grow
  426.                     dc i2'doClose'      ; TASK 6 in goaway
  427.                     dc i2'Ignore'       ; TASK 7 in zoom
  428.                     dc i2'Ignore'       ; TASK 8 in info bar
  429.                     dc i2'MenuSelect'   ; TASK 9 in special menu
  430.                     dc i2'Ignore'       ; TASK 10 in NDA
  431.                     dc i2'Ignore'       ; TASK 11 in frame
  432.                     dc i2'Ignore'       ; TASK 12 in drop
  433.  
  434.                     end
  435.  
  436.                     EJECT
  437. *******************************************************************************
  438. *
  439. MenuSelect          start
  440. *
  441. * Description:      This routine is called when TaskMaster returns a menu
  442. *                   event. It takes the menu item that was hit and calculates
  443. *                   an offset into the menu dispatch table. It then calls that
  444. *                   routine and unhilites the menu when it is done.
  445. *
  446. * Inputs:           TaskData holds menu item selected.
  447. *
  448. * Outputs:          NONE
  449. *
  450. * External Refs:
  451. *                   Import Ignore
  452. *                   Import doAbout
  453. *                   Import doQuit
  454. *                   Import doOpen1
  455. *                   Import doOpen2
  456. *                   Import doOpen3
  457. *                   Import doClose
  458. *
  459. * Entry Points:     NONE
  460. *
  461. *******************************************************************************
  462.                     using Globals
  463.  
  464.                     lda TaskData        ; Get the ID of the menu item selected.
  465.                     sec                 ; Turn it into an index by subtracting
  466.                     sbc #250            ; the starting ID number (250) and mul-
  467.                     asl a               ; tiplying by 2 (each table entry con-
  468.                     tax                 ; sists of 2 bytes).
  469.                     jsr (MenuTable,x)   ; Call the routine behind it.
  470.  
  471.                     PushWord #0         ; Routine done - unhilite the menubar.
  472.                     PushWord TaskData+2
  473.                     _HiLiteMenu
  474.  
  475.                     rts
  476.  
  477. MenuTable           dc i2'Ignore'       ; undo
  478.                     dc i2'Ignore'       ; cut
  479.                     dc i2'Ignore'       ; copy
  480.                     dc i2'Ignore'       ; paste
  481.                     dc i2'Ignore'       ; clear
  482.                     dc i2'doClose'      ; close
  483.                     dc i2'doAbout'      ; about this program
  484.                     dc i2'doQuit'       ; quit selected
  485.                     dc i2'doOpen1'      ; open a custom window
  486.                     dc i2'doOpen2'      ; open another custom window
  487.                     dc i2'doOpen3'      ; open a normal window
  488.                     end
  489.  
  490.                     EJECT
  491. *******************************************************************************
  492. *
  493. Ignore              start
  494. *
  495. * Description:      Called when I want to ignore an event.
  496. *
  497. *
  498. * Inputs:           NONE
  499. *
  500. * Outputs:          NONE
  501. *
  502. * External Refs:    NONE
  503. *
  504. * Entry Points:     NONE
  505. *
  506. *******************************************************************************
  507.  
  508.                     rts
  509.                     end
  510.  
  511.                     EJECT
  512. *******************************************************************************
  513. *
  514. doNullEvent         start
  515. *
  516. * Description:      Performs tasks when there is nothing else to do...In this
  517. *                   case, draw the time in the menubar.
  518. *
  519. *
  520. * Inputs:           NONE
  521. *
  522. * Outputs:          NONE
  523. *
  524. * External Refs:    NONE
  525. *
  526. * Entry Points:     NONE
  527. *
  528. *******************************************************************************
  529.                     using Globals
  530.  
  531.                     pha                 ; get the time
  532.                     pha
  533.                     pha
  534.                     pha
  535.                     _ReadTimeHex
  536.  
  537.                     lda 1,s             ; compare to see if 1 second
  538.                     cmp oldTime         ; has passed...
  539.                     bne DrawTime
  540.  
  541.                     lda 3,s
  542.                     cmp oldTime+2
  543.                     bne DrawTime
  544.  
  545.                     lda 5,s
  546.                     cmp oldTime+4
  547.                     bne DrawTime
  548.  
  549.                     lda 7,s
  550.                     cmp oldTime+6
  551.                     bne DrawTime
  552.                     brl ExitNull        ; no it hasn't...do nothing
  553.  
  554. DrawTime            ANOP                ; time has passed, draw it.
  555.                     pha                 ; save the old port
  556.                     pha
  557.                     _GetPort
  558.                     PullLong oldPort
  559.  
  560.                     pha                 ; switch to the menu manager port
  561.                     pha
  562.                     _GetMenuMgrPort
  563.                     lda 1,s             ; save this for metrics later
  564.                     sta temp1
  565.                     lda 3,s
  566.                     sta temp1+2
  567.                     _SetPort
  568.  
  569.                     PushLong #TimeString ; get the time as a string
  570.                     _ReadAsciiTime
  571.  
  572.                     ldx #18             ; strip off the high bits
  573. loop                lda TimeString,x
  574.                     and #$7F7F
  575.                     sta TimeString,x
  576.                     dex
  577.                     dex
  578.                     bpl loop
  579.  
  580.                     pha                 ; get the length of the time string
  581.                     PushLong #TimeString
  582.                     _CStringWidth
  583.  
  584. ; put it on the screen so that its right edge is 10 pixels from
  585. ; the right edge of the screen. It is always positioned 10 pixels
  586. ; down from the top of the screen.
  587.  
  588.                     ldy #oportRect+6
  589.                     lda [<temp1],y
  590.                     sec
  591.                     sbc 1,s             ; subtract the width on the stack
  592.                     sbc #10             ; plus some...
  593.                     sta 1,s             ; push on the X-Coord
  594.                     ldy #oportRect
  595.                     lda [<temp1],y
  596.                     clc
  597.                     adc #10             ; push on the Y-coord
  598.                     pha
  599.                     _MoveTo
  600.  
  601. ; Save and set the text mode to modeCopy
  602.                     pha
  603.                     _GetTextMode
  604.  
  605.                     PushWord #0
  606.                     _SetTextMode
  607.  
  608. ; Finally draw the string
  609.  
  610.                     PushLong #TimeString
  611.                     _DrawCString
  612.  
  613. ; Reset the text mode and the GrafPort
  614.  
  615.                     _SetTextMode
  616.  
  617.                     PushLong oldPort
  618.                     _SetPort
  619.  
  620. ExitNull            ANOP
  621.                     PullLong oldTime
  622.                     PullLong oldTime+4
  623.  
  624.                     rts
  625.  
  626. oldTime             dc i1'0,0,0,0,0,0,0,0'
  627. oldPort             ds 4
  628.  
  629. TimeString          ds 20
  630.                     dc i1'0'
  631.  
  632.                     end
  633.  
  634.                     EJECT
  635. *******************************************************************************
  636. *
  637. doUpdate            start
  638. *
  639. * Description:      Called by TaskMaster to perform updates. This routine
  640. *                   does nothing, as we have nothing to update with!
  641. *
  642. *
  643. * Inputs:           NONE
  644. *
  645. * Outputs:          NONE
  646. *
  647. * External Refs:    NONE
  648. *
  649. * Entry Points:     NONE
  650. *
  651. *******************************************************************************
  652.                     using Globals
  653.  
  654.                     rtl
  655.                     end
  656.  
  657.                     EJECT
  658. *******************************************************************************
  659. *
  660. doQuit              start
  661. *
  662. * Description:      Quit routine. Set the QuitFlag to TRUE for the EventLoop.
  663. *
  664. *
  665. * Inputs:           NONE
  666. *
  667. * Outputs:          QuitFlag set to $FFFF
  668. *
  669. * External Refs:    NONE
  670. *
  671. * Entry Points:     NONE
  672. *
  673. *******************************************************************************
  674.                     using Globals
  675.  
  676.                     lda #$FFFF
  677.                     sta QuitFlag
  678.                     rts
  679.                     end
  680.  
  681.  
  682.                     EJECT
  683. *******************************************************************************
  684. *
  685. doAbout             start
  686. *
  687. * Description:      Bring up an AlertWindow box with our name in it. This call
  688. *                   was added on System Disk 3.2.
  689. *
  690. * Inputs:           NONE
  691. *
  692. * Outputs:          NONE
  693. *
  694. * External Refs:    NONE
  695. *
  696. * Entry Points:     NONE
  697. *
  698. *******************************************************************************
  699.                     using Globals
  700.  
  701.                     pha                 ; space for result
  702.                     PushWord #1         ; we are using P-Strings
  703.                     PushLong #SubStrings
  704.                     PushLong #AboutData
  705.                     _AlertWindow        ; new macro defined above
  706.                     pla                 ; pull off button hit
  707.  
  708.                     rts
  709.  
  710.                     end
  711.  
  712.                     EJECT
  713. *******************************************************************************
  714. *
  715. doOpen              start
  716. *
  717. * Description:      Opens a window by making it visible.
  718. *
  719. *
  720. * Inputs:           NONE
  721. *
  722. * Outputs:          NONE
  723. *
  724. * External Refs:    NONE
  725. *
  726. * Entry Points:
  727. *                   entry doOpen1
  728. *                   entry doOpen2
  729. *                   entry doOpen3
  730. *
  731. *******************************************************************************
  732.                     using Globals
  733.                     
  734. doOpen1             entry
  735.                     lda TestWindow
  736.                     ldx TestWindow+2
  737.                     bra CommonOpen
  738.  
  739. doOpen2             entry
  740.                     lda TestWindow2
  741.                     ldx TestWindow2+2
  742.                     bra CommonOpen
  743.  
  744. doOpen3             entry
  745.                     lda NormalWindow
  746.                     ldx NormalWindow+2
  747.  
  748. CommonOpen          ANOP
  749.                     phx                 ; push the window ptr on for ShowWind
  750.                     pha
  751.                     phx                 ; and push a set on for Select
  752.                     pha
  753.                     _SelectWindow       ; bring it to front
  754.                     _ShowWindow         ; and show it.
  755.  
  756.                     rts
  757.  
  758.                     end
  759.  
  760.  
  761.                     EJECT
  762. *******************************************************************************
  763. *
  764. doClose             start
  765. *
  766. * Description:      Closes a window by making it invisible.
  767. *
  768. *
  769. * Inputs:           NONE
  770. *
  771. * Outputs:          NONE
  772. *
  773. * External Refs:    NONE
  774. *
  775. * Entry Points:     NONE
  776. *
  777. *******************************************************************************
  778.                     using Globals
  779.  
  780.                     pha                 ; get the front window
  781.                     pha
  782.                     _FrontWindow
  783.                     _HideWindow         ; and hide it
  784.  
  785.                     rts
  786.                     end
  787.  
  788.                     copy cwnd.inits.asm
  789.                     copy rr.wnd.asm1
  790.                     copy rr.wnd.asm2
  791.  
  792.                     END
  793.